<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
    <head>
        <th:block th:include="include::header('流程设计')" />
    </head>
    <body class="febs-container">
        <div class="febs-body layui-fluid" id="febs-workflowInfo" lay-title="流程设计">
            <div class="febs-body-search">
                <form class="layui-form layui-table-form" lay-filter="workflowInfo-table-form" id="workflowInfo-table-form">
                    <div class="layui-card">
                        <div class="layui-card-body">
                            <div class="layui-form-item">
                                <div class="layui-inline" id="role-tenant" th:if="${hasHeadCompanyRole}">
                                    <label class="layui-form-label layui-form-label-sm">管理公司</label>
                                    <div class="layui-input-inline" style="width:280px;">
                                        <select name="tenantId" id="tenantId" lay-search="">
                                            <option th:each="item:${tenantList }"
                                                    th:value="${item.tenantId}" th:text="${item.tenantName}"
                                                    th:selected="${currentTenantId == item.tenantId}">
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label layui-form-label-sm">流程名称</label>
                                    <div class="layui-input-inline" style="width:200px;">
                                        <input type="text" name="workflowName" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <div id="query" class="layui-btn">
                                        <em class="layui-icon">&#xe615;</em> 查询
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="febs-table-full">
                <table lay-filter="workflowInfoTable" lay-data="{id: 'workflowInfoTable'}"></table>
            </div>
            <script type="text/html" id="status-bar">
                <input type="checkbox" name="workflowStatus" value="{{d.workflowId}}" lay-skin="switch" lay-text="发布|禁用" lay-filter="workflowStatus" {{ d.workflowStatus == '1' ? 'checked' : '' }} />
            </script>
            <script type="text/html" id="workflowInfo-bar">
                <button type="button" class="layui-btn layui-btn-primary layui-btn-xs layui-border-orange" title="配置流程" lay-event="edit"  shiro:hasAnyPermissions="workflowInfo:view">
                    <em class="layui-icon layui-icon-set"></em>
                    流程配置
                </button>
            </script>
        </div>
        <th:block th:include="include::foot" />
        <script data-th-inline="javascript" >
            let currentTenantId = [[${currentTenantId}]];
            let tenantList = [[${tenantList}]];
            let hasHeadCompanyRole = [[${hasHeadCompanyRole}]];
        </script>
        <script th:src="@{/febs/js/workflow/workflowInfo/workflowInfoList.js(v=1)}"></script>
    </body>
</html>